<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<%@ include file="common.jsp" %>
<%            // Main Application Logic Comes Here

%>

<HTML>
    <c:set var="title" value="MIC Tycoon ~ Player Transaction Page"/>
    <%@ include file="htmlheader.jsp" %>

    <body>
        <div id="resolution">

            <%@ include file="header.jsp" %>
            <%@ include file="menu.jsp" %>

            <div class="content">

                <div id="transaction-paper">
                <!-- TRANSACTION LOG -->
                <div id="transaction_list">
                    <c:forEach items="${transaction_turn_list}" var="transaction_turn">
                        <table class="transaction_table" cellspacing="0" cellpadding="5">
                            <!-- print out the turn as a header to group the transaction -->

                            <tr>
                                <td colspan="1" class="transaction_header"> Turn # ${transaction_turn.turn}</td>
                                <td colspan="3" class="transaction_header"> Remaining Balance: ${transaction_turn.remaining_balance_string}</td>
                            </tr>
                            <tr>
                                <td class="transaction_title" width="300px">Transaction Details</td>
                                <td class="transaction_title" width="60px">Debit</td>
                                <td class="transaction_title" width="60px">Credit</td>
                                <td class="transaction_title" width="100px">Balance</td>
                            </tr>
                            <c:forEach items="${transaction_turn.transaction_list}" var="transaction">
                                <tr>
                                    <td class="transaction_value" id="description">${transaction.description}</td>
                                    <td class="transaction_value" id="debit">${transaction.debit_string}</td>
                                    <td class="transaction_value" id="credit">${transaction.credit_string}</td>
                                    <td class="transaction_value">${transaction.balance_string}</td>
                                </tr>
                            </c:forEach>
                        </table>
                    </c:forEach>
                </div>
                </div>

                <!-- FORCASTED BALANCE -->
                <div id="forecast-paper">
                    <div id="forecasted_balance">
                    <table cellspacing="5" cellpadding="5">
                        <tr>
                            <td colspan="2" class="transaction_header"> Forecasted For Turn #${turn.current_turn+1}</td>
                        </tr>
                        <tr><td class="transaction_title">Employee Salary</td> </tr>
                        <tr><td class="transaction_value" id="credit">${next_employee_salary}</td></tr>
                        <tr><td class="transaction_title">Rental Cost</td></tr>
                        <tr><td class="transaction_value" id="credit">${next_rental}</td>
                        <tr><td class="transaction_title">Remaining Balance</td></tr>
                        <tr><td class="transaction_value"><font color="blue"><b>${next_balance}</b></font></td></tr>
                    </table>
                    </div>
                </div>
            </div>
        </div>

    </BODY>
</HTML>